package com.sense.kukoo.biz_me.model

import com.sense.kukoo.common.mvvm.model.BaseMvvmModel
import com.sense.kukoo.common.repo.bean.ResultBean
import com.sense.kukoo.common.repo.http.KukooHttpApi
import com.sense.kukoo.common.repo.http.KukooHttpManager
import com.sense.kukoo.common.repo.http.bean.IndexContentBean
import com.sense.kukoo.common.repo.http.bean.UserInfoBean

class MeModel : BaseMvvmModel() {

    override fun onModelCleared() {}

    suspend fun getUserInfo(): ResultBean<UserInfoBean> {
        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .getUserInfo("0")
    }

    suspend fun getUserContent(
        pageIndex: Int,
        pageSize: Int
    ): ResultBean<List<IndexContentBean>> {
        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .userSearchById("${pageIndex}", "${pageSize}", "0")
    }

}